import {Room} from "../sql/domin";
import {arrayToMap, deleteSql, insertSql, selectSql} from "../util/sqlUtils";

export class RoomMapper {

    public static insertRoomList(rooms: Room[]) {
        return insertSql('room',
            arrayToMap(rooms))
    }

    public static selectRoomListDeptId(deptId: number) {
        return selectSql('room',
            new Map<string, any>([
                ['deptId', deptId]
            ]))
    }

    public static selectRoomList() {
        return selectSql('room')
    }

    public static deleteRoomListByDeptId(deptId: number) {
        return deleteSql('room',
            'where deptId = ' + deptId)
    }

    public static deleteRoomListAll() {
        return deleteSql('room', "")
    }

}
